package base.方法引用;

import java.util.ArrayList;
import java.util.Arrays;

public class 练习_3 {
    public static void main(String[] args) {
        /*把姓名和年龄拼接成：张三-23的字符串，并方法数组当中*/

        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student("王五",25));
        list.add(new Student("赵六",35));

        String[] arr = list.stream().map(Student::toString).toArray(String[]::new);
        System.out.println(Arrays.toString(arr));

        System.err.println("我是异常信息哇！！");
    }
}
